#!/bin/sh


if [ -d ./.git ]
then
GITLAB=`git log -1 | grep -E "^commit" | sed 's/commit //g'`
else
GITLAB=00
fi

HARD_VER_MAJ_NO=01
HARD_VER_MIN_NO=00

VER_MAJ_NO=1
VER_MIN_NO=0.0

HARD_VER=A0.$HARD_VER_MAJ_NO.$HARD_VER_MIN_NO

VER_MAIN_NO=L1


DATE=$(date +"%Y-%m-%d %H:%M.%S %Z")
VER_DATE=$(date +%g)$(date +%m)$(date +%d)

VER=$VER_MAJ_NO.$VER_MIN_NO.${VER_DATE}_$VER_MAIN_NO

echo "set version $VER"
echo "set telnet version  $VER_DATE"
echo "set version TIME $DATE"
version_info=`cat conf/version.h | sed "s/RevTag/$VER/g" | sed "s/RevTIME/$DATE/g" | sed "s/LS_MAJ/$VER_MAJ_NO/g" | sed "s/LS_MIN/$VER_MIN_NO/g" | sed "s/RevGITLAB/$GITLAB/g" | sed "s/RevHardVer/$HARD_VER/g"`
echo "$version_info" > application/common/ls_version.h


ln -sf $PWD/conf/BLWD1/series_conf.h  application/common/ls_series_conf.h
ln -sf $PWD/conf/BLWD1/proj.conf  application/ls_proj.conf

